import {createRouter, createWebHashHistory} from "vue-router";
import Login from "./components/Login.vue";
import Register from "./components/Register.vue";
import ApplicantMain from "./components/ApplicantMain.vue";
import ApproverMain from "./components/ApproverMain.vue";
import AddNewApplication from "./components/applicantMainComponents/AddNewApplication.vue";
import ApplicantDefaultApplication from "./components/applicantMainComponents/ApplicantDefaultApplication.vue";
import ApplicantRedoApplication from "./components/applicantMainComponents/ApplicantRedoApplication.vue";
import ApproverDefaultApplication from "./components/approverMainComponents/ApproverDefaultApplication.vue";
import ApproverRedoApplication from "./components/approverMainComponents/ApproverRedoApplication.vue";
import DefaultReason from "./components/approverMainComponents/DefaultReason.vue";
import PieEcharts from "./components/ecahrtsComponents/PieEcharts.vue";
import LineEcharts from "./components/ecahrtsComponents/LineEcharts.vue";








const router=createRouter({
    history: createWebHashHistory(),
    routes: [
        //访问转登录页面
        { path: '/', redirect: '/login'},
        //login页面
        {
            path: '/login',
            component: Login,
            name:'Login',

        },
        //注册页面
        {
            path:'/register',
            component: Register,
            name:'Register'
        },
        //申请人主页面
        {
            path:'/applicantMain',
            component: ApplicantMain,
            name:'ApplicantMain',
            redirect:'/applicantMain/addNewApplication',
            children: [
                {path:'addNewApplication',component:AddNewApplication},
                {path:'applicationDefaultApplication',component:ApplicantDefaultApplication},
                {path:'applicantRedoApplication',component:ApplicantRedoApplication}
            ]


        },
        //审核人主页面
        {
            path:'/approverMain',
            component: ApproverMain,
            name:'ApproverMain',
            redirect:'/approverMain/approverDefaultApplication',
            children:[
                {path: 'approverDefaultApplication',component: ApproverDefaultApplication},
                {path: 'approverRedoApplication',component: ApproverRedoApplication},
                {path: 'defaultReason',component: DefaultReason}
            ]
        },
        //饼图
        {
            path:'/pieEcharts',
            component: PieEcharts,
            name:'PieEcharts'
        },
        //折线图
        {
            path:'/lineEcharts',
            component: LineEcharts,
            name:'LineEcharts'
        }






    ]


})



export default router